﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" xmlns:local="clr-namespace:Trackr.GUI.Views"
        xmlns:viewModels="clr-namespace:Trackr.GUI.ViewModels" x:Class="Trackr.GUI.Views.MainWindow"
        Title="Time Trackr" Icon="Images/time.ico" Width="476" MinHeight="250" SizeToContent="Height" AllowsTransparency="True" WindowStyle="None" Topmost="True" BorderThickness="6" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Margin="0" Padding="0" Background="{x:Null}">
	<Window.DataContext>
		<viewModels:MainWindowViewModel />
	</Window.DataContext>
	<Window.InputBindings>
		<KeyBinding Key="Left" Command="{Binding LeftKeyDownCommand}"/>
		<KeyBinding Key="Right" Command="{Binding RightKeyDownCommand}"/>
        <KeyBinding Key="LeftCtrl"></KeyBinding>
	</Window.InputBindings>
	<Window.Resources> 
  <Style x:Key="CustomStyle" TargetType="{x:Type TextBox}">
     <Setter Property="Background" Value="AliceBlue" />
	 <Setter Property="BorderThickness" Value="0"/>
  </Style>
 </Window.Resources>
	<Border Name="BorderMain"  BorderThickness="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" UseLayoutRounding="True" CornerRadius="5" BorderBrush="#00C82020" Background="#FF4B95D8" >
		<!--<Border.Background>
			<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
				<GradientStop Color="#FF4B95D8" Offset="0"/>
				<GradientStop Color="#FF4B95D8" Offset="1"/>
			</LinearGradientBrush>
		</Border.Background>-->
		<Border.Effect>
			<DropShadowEffect Direction="305" BlurRadius="5" RenderingBias="Quality" ShadowDepth="1" Opacity="0.8"/>
		</Border.Effect>
		<Grid x:Name="gridMain" Margin="3">
			<Grid.RowDefinitions>
				<RowDefinition x:Name="rowHeader" Height="40" />
				<RowDefinition x:Name="rowInput" Height="50" />
				<RowDefinition x:Name="rowContentItems" Height="*" />
			</Grid.RowDefinitions>
			<Grid x:Name="gridHeader" Grid.Row="0">
				<Grid.ColumnDefinitions>
					<ColumnDefinition x:Name="colControls" Width="90" /> 		
					<ColumnDefinition x:Name="colInput" Width="*" />
					<ColumnDefinition x:Name="colClose" Width="90" />
				</Grid.ColumnDefinitions>
				<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0">
					<Image Source="Images/back_white.png" Stretch="Fill" Height="20" Margin="5,0,10,0" Cursor="Hand" Name="imagePreviousWeek">
						<Image.InputBindings>
							<MouseBinding MouseAction="LeftClick" Command="{Binding ShowPreviousWeek}" />
						</Image.InputBindings>
					</Image>
					<Image Source="Images/next_white.png" Stretch="Fill" Height="20" Cursor="Hand" Name="imageNextWeek">
						<Image.InputBindings>
							<MouseBinding MouseAction="LeftClick" Command="{Binding ShowNextWeek}" />
						</Image.InputBindings>
					</Image>
				</StackPanel>
				<Label Content="{Binding CurrentWeekNrText}" Grid.Column="1" FontFamily="Segoe WP N Light" Margin="0"  VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Background="{x:Null}"  Foreground="White" />
				<Image Source="Images/cancel_white.png" Grid.Column="2" Stretch="Fill" HorizontalAlignment="Right" VerticalAlignment="Top"  Height="30" Width="30"  Name="imageClose" Cursor="Hand" />

			</Grid><!--/gridHeader-->
			<Grid x:Name="gridInput" Grid.Row="1" Margin="0,0,0,10">
				<Border Name="InputBorder" BorderThickness="1" Margin="5" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" UseLayoutRounding="True" CornerRadius="3" BorderBrush="LightGray" >
					<TextBox Name="inputTask" Style="{StaticResource CustomStyle}" Text="{Binding PlaceholderText}" Padding="4" FontFamily="Segoe WP Light" FontSize="16" VerticalAlignment="Center" Background="Transparent" BorderBrush="Transparent" VerticalContentAlignment="Stretch" HorizontalAlignment="Stretch">
						<TextBox.InputBindings>
							<KeyBinding Key="Enter" CommandParameter="{Binding Text, ElementName=inputTask}" Command="{Binding SubmitTaskCommand}"/>
						</TextBox.InputBindings>
					</TextBox>
				
				</Border>
			</Grid>
            <Grid Grid.Row="2" Margin="-3,0,-3,0" HorizontalAlignment="Stretch" Name="stackPanelWeekViews" VerticalAlignment="Stretch">
                <Grid x:Name="gridSplit">
                    <Grid.RowDefinitions>
                        <RowDefinition x:Name="colChart" Height="0" MaxHeight="0" />
                        <RowDefinition x:Name="colItems" Height="*" />
                    </Grid.RowDefinitions>

                    <!--CHART-->
                    <Canvas x:Name="canvas" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Visibility="Collapsed" Height="120">
                        <Canvas.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFEFFFE" Offset="0"/>
                                <GradientStop Color="#FFDFE9F3" Offset="1"/>
                            </LinearGradientBrush>
                        </Canvas.Background>
                        <Polyline x:Name="polyline" Stroke="#FF2D5D89" StrokeThickness="3" Points="10,50 100,80 150,20 200,60 300,20 350,90 390,20" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="5, 45,0,0" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="95, 75,0,0" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="145, 15,0,0" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="195, 55,0,0" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="295, 15,0,0" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="345, 85,0,0" />
                        <Ellipse Fill="#FF2D5D89" StrokeThickness="1" Width="10" Height="10" Margin="385, 15,0,0" />
                    </Canvas>
                    <GridSplitter  HorizontalAlignment="Stretch" Grid.Row="0" VerticalAlignment="Bottom" ResizeBehavior="CurrentAndNext" Height="5" Background="#FF80ADD6" />
                    <!--Day Views-->
                    <StackPanel Grid.Row="1" x:Name="stackPanelDayItems" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                        <StackPanel.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFEFFFE" Offset="0"/>
                                <GradientStop Color="#FFDFE9F3" Offset="1"/>
                            </LinearGradientBrush>
                        </StackPanel.Background>
                        <ItemsControl ItemsSource="{Binding Path=CurrentWeek.Days}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Grid x:Name="gridTimeItems" Margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition x:Name="colWeek" Width="70" />
                                            <ColumnDefinition x:Name="colTimeItems" Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <Label Content="{Binding DisplayDate}" Name="LabelDate" Grid.Column="0" FontFamily="Segoe WP" FontSize="20" BorderThickness="0,0,2,0" BorderBrush="#647F9CB7"></Label>
                                        <ListBox Grid.Column="1" Name="stackPanelTimeItems" DataContext="{Binding TimeEntries}" Background="Transparent">
                                           <Grid Margin="0" Height="33">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition x:Name="colTask" Width="*" />
                                                    <ColumnDefinition x:Name="colTime" Width="100" />
                                                </Grid.ColumnDefinitions>
                                                <Label Width="220" ToolTip="{Binding Task}" Content="{Binding Task}" Name="Task" Grid.Column="0" FontFamily="Segoe WP N Light" FontSize="18" VerticalAlignment="Bottom" Background="{x:Null}" Margin="15,0" />
                                                <Label Content="{Binding TaskDuration}" Name="Duration" Grid.Column="1" FontFamily="Segoe WP N" FontWeight="DemiBold" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="14" Background="{x:Null}" />
                                            </Grid>
                                        </ListBox>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                         </ItemsControl>
                        <!--<Grid x:Name="gridTimeItems" Margin="0" DataContext="{Binding CurrentWeek.Days}"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="colWeek" Width="70" />
                                <ColumnDefinition x:Name="colTimeItems" Width="*" />
                            </Grid.ColumnDefinitions>

                            <Label Content="{Binding DisplayDate}" Name="LabelDate" Grid.Column="0" FontFamily="Segoe WP" FontSize="20" BorderThickness="0,0,2,0" BorderBrush="#647F9CB7">-->
                                
                                <!--<Label.Background>
				<LinearGradientBrush EndPoint="1,0" StartPoint="0,0" ColorInterpolationMode="SRgbLinearInterpolation">
					<GradientStop Color="#96FEFFFE" Offset="0"/>
					<GradientStop Color="#96DFE9F3" Offset="1"/>
				</LinearGradientBrush>
			</Label.Background>-->
                            <!--</Label>
                            <ListBox Grid.Column="1" Name="stackPanelTimeItems" ItemsSource="{Binding TimeEntries}" Background="Transparent">
                                <Grid Margin="0" Height="33">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition x:Name="colTask" Width="*" />
                                        <ColumnDefinition x:Name="colTime" Width="100" />
                                    </Grid.ColumnDefinitions>
                                    <Label Width="220" ToolTip="{Binding Task}" Content="{Binding Task}" Name="Task" Grid.Column="0" FontFamily="Segoe WP N Light" FontSize="18" VerticalAlignment="Bottom" Background="{x:Null}" Margin="15,0" />
                                    <Label Content="{Binding TaskDuration}" Name="Duration" Grid.Column="1" FontFamily="Segoe WP N" FontWeight="DemiBold" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="14" Background="{x:Null}" />
                                </Grid>
                            </ListBox>
                        </Grid>-->

                    </StackPanel>
                </Grid>
            </Grid>

        </Grid><!--/gridMain-->
	</Border>  
</Window>
